package nero.yncc.com.createart.custom;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.GridView;

/**
 * Created by Administrator.
 * Time:2017/3/14 11:51.
 * 用于嵌套到scrollView中，防止和scrollView滑动冲突
 */

public class NoTouchGridView extends GridView {
    public NoTouchGridView(Context context) {
        super(context);
    }

    public NoTouchGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NoTouchGridView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        // TODO Auto-generated method stub
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }


    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        return false;
    }

}
